<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <link rel="apple-touch-icon" sizes="76x76" href="/img/apple-icon.png">
    <link rel="icon" type="image/png" href="/img/favicon.png">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <title>
        AntRpc Console
    </title>
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
          name='viewport'/>
    <!--     Fonts and icons     -->
    <link href="/css/google-fonts.css" rel="stylesheet"/>
    <link rel="stylesheet" href="/css/fontawesome-v5.7.1-all.css">
    <!-- CSS Files -->
    <link href="/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="/css/now-ui-dashboard.min.css" rel="stylesheet"/>
    <link href="/css/my.css" rel="stylesheet"/>
    <!-- CSS Just for demo purpose, don't include it in your project -->

</head>
<body>
<div class="wrapper ">
    <div th:replace="~{common :: #common-sidebar}"></div>
    <div class="main-panel" id="main-panel">
        <nav id="common-config-nav" class="navbar navbar-expand-lg navbar-transparent  bg-primary  navbar-absolute">
            <div class="container-fluid my-padding-left-top-0">
                <div th:replace="~{common :: #commons-nav-btns}"></div>
                <div class="collapse navbar-collapse justify-content-end w-100" id="config-navigation">
                </div>
            </div>
        </nav>
        <div class="panel-header panel-header-sm"></div>
        <div class="content">
            <div class="row">
                <div class="col-md-12">
                    <ol class="breadcrumb my-breadcrumb">
                        <li class="breadcrumb-item"><a href="/configs">环境列表</a></li>
                        <li class="breadcrumb-item">
                            <a th:href="@{'/configSpaces?envName=' + ${envName}}"
                               th:text="${envName}"></a>
                        </li>
                        <li class="breadcrumb-item">
                            <a th:href="@{'/configKeys?envName=' + ${envName} + '&spaceName=' + ${spaceName} }"
                               th:text="${spaceName}"></a>
                        </li>
                        <li class="breadcrumb-item active">批量新建</li>
                    </ol>
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="card card-chart">
                        <div class="card-header">
                            <h5 class="card-title">批量新建Key-Value <span class="description">保存会立即生效</span></h5>
                        </div>
                        <div class="card-body">
                            <form id="batch_form" action="/saveBatchCreateConfigs" method="post">
                                <input type="hidden" name="envName" id="env_name_elem" th:value="${envName}"/>
                                <input type="hidden" name="spaceName" id="space_name_elem" th:value="${spaceName}"/>
                                <div class="form-group">
                                    <label for="config_content_elem">类型:</label>
                                    <div>
                                        <div class="form-check form-check-radio my-display-inline-block ml-0 pl-0">
                                            <label class="form-check-label">
                                                <input class="form-check-input" type="radio" name="type"
                                                       id="yaml_elem" value="yaml">
                                                <span class="form-check-sign"></span>
                                                Yaml格式
                                            </label>
                                        </div>
                                        <div class="form-check form-check-radio my-display-inline-block">
                                            <label class="form-check-label">
                                                <input class="form-check-input" type="radio"
                                                       name="type"
                                                       id="prop_elem" value="prop" checked>
                                                <span class="form-check-sign"></span>
                                                Properties格式
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="config_content_elem">配置内容(一个配置项单独一行):</label>
                                    <textarea name="content" id="config_content_elem" rows="15"
                                              class="form-control my-textarea"></textarea>
                                </div>
                            </form>
                        </div>
                        <div class="card-footer">
                            <div class="container-fluid">
                                <div class="row">
                                    <div class="col-md-12">
                                        <button type="button" onclick="batch_form_submit();"
                                                class="btn btn-primary float-right mr-2">
                                            保存
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<div th:insert="js"></div>
<script>

    function batch_form_submit() {
        $("#batch_form").submit();
    }

    $(document).ready(function () {
        $("#config_list_li").addClass("active");
    });

</script>
</body>
</html>